<template>
  <section>
    <el-table :data="examine.examineItems" style="width: 100%">
      <el-table-column type="index" width="50"/>
      <el-table-column prop="name" label="项目" width="120">
      </el-table-column>
      <el-table-column label="总结" width="300">
        <template slot-scope="scope">
          <div v-html="scope.row.summary" v-if="scope.row.examineType.code !== 'DMS'"/>
          <el-button v-if="scope.row.examineType.code === 'DMS'" type="text" size="mini" @click="preview(scope.row)">{{scope.row.summary}}</el-button>
        </template>
      </el-table-column>
      <el-table-column label="签名" width="150">
        <template slot-scope="scope">
          <el-popover placement="top" width="400" trigger="hover">
            <!--<el-row> -->
            <img :src="scope.row.signature"/>
            <!--</el-row>-->
            <el-row slot="reference"><img :src="scope.row.signature" width="100px"/></el-row>
          </el-popover>
        </template>
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button v-if="scope.row.examineType.code !== 'DMS' && type === 'show'" @click="detailItem(scope)" type="text" size="small">详情</el-button>
          <el-button v-else-if="scope.row.examineType.code === 'DMS'" @click="selDMS(scope)" type="text" size="small">导入</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-dialog :visible.sync="dialogShow" :close-on-click-modal="false" v-if="dialogShow" >
      <examineDetail :examineItem="examineItem" type="show" v-on:close="close"></examineDetail>
    </el-dialog>
  </section>
</template>

<script>
  import examineDetail from '@/components/health_check/answerDetail'
  import { mapActions} from 'vuex'
  export default {
    name: "examineShow",
    props: ['examine','type'],
    components:{examineDetail},
    data() {
      return {
        currExamine:null,
        dialogShow:false,
        examineItem:null
      }
    },
    created() {
      console.log(this.examine)
    },
    methods: {
      ...mapActions({
        fetch: 'fetch'
      }),
      detailItem(scope){
        this.examineItem=scope.row
        if(this.examineItem){
          console.log(this.examineItem)
          this.dialogShow = true
        }
      },
      close(){
        this.dialogShow=false
      },
    }
  }
</script>

<style scoped>

</style>
